package game.players;

import com.uqbar.vainilla.DeltaState;

import game.ball.SoccerBall;
import game.components.UserPlayerMark;
import game.components.WorldSprite;
import game.players.states.PlayerState;
import game.soccerField.Arc;

public abstract class SoccerPlayer extends WorldSprite {
	
	private int movementSpeed = 10;
	private int feetHeight    = 10;
	private int feetWidth     = 10;
	
	private PlayerState state;
	private Arc rivalArc;
	private SoccerBall ball;

	
	public SoccerPlayer(int x, int y) {
		super(x,y);
	}
	
	public boolean isWithBall() {
		return this.getState().isWithBall();
	}
	
	/**
	 * elimina la marca del jugador anterior y setea la nueva
	 */
	public void addUserPlayerMark(){
		this.getScene().removeUserPlayerMark();
		this.getScene().setUserPlayerMark(new UserPlayerMark(this));
	}
	
	public int getFeetHeight() {
		return feetHeight;
	}
	
	public int getFeetWidth() {
		return feetWidth;
	}
	
	@Override
	public void update(DeltaState deltaState) {
		this.getState().update(deltaState);
		super.update(deltaState);
	}
	
	
	


	public int getMovementSpeed() {
		return movementSpeed;
	}
	
	public PlayerState getState() {
		return state;
	}

	public void setState(PlayerState state) {
		this.state = state;

	}

	public void setRivalArc(Arc arc) {
		this.rivalArc = arc;				
	}
	
	public Arc getRivalArc() {
		return rivalArc;
	}

	public SoccerBall getBall() {
		return ball;
	}

	public void setBall(SoccerBall ball) {
		this.ball = ball;
	}
	
	
	
	
}
